package ast;
import type.*;
//其中typeNode保存着sizeof(expr)整体的类型,parser中解析为size_t类型,即ulong.
public class SizeofExprNode extends ExprNode {
    protected ExprNode expr;
    protected TypeNode type;

    public SizeofExprNode(ExprNode expr, TypeRef type) {
        this.expr = expr;
        this.type = new TypeNode(type);
    }

    public ExprNode expr() {
        return this.expr;
    }

    public void setExpr(ExprNode expr) {
        this.expr = expr;
    }

    public Type type() {
        return this.type.type();
    }

    public TypeNode typeNode() {
        return this.type;
    }

    public Location location() {
        return expr.location();
    }
    public void printTree(Dumper d){
    	d.printMember("expr: ",expr);
    }
    public<S,E> E  accept(ASTVisitor<S, E> visitor){
    	return visitor.visit(this);
    }
}

